package com.interceptor;

import com.entity.User;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class BackLogin implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
//            //登陆成功之后，获取用户的session
//            User loginUser = (User)request.getSession().getAttribute("User");
//            if (loginUser==null){
//                // 未登录
//                response.sendRedirect(request.getContextPath()+"/pages/background/back_login.html");
//                return false;
//            }else {
                return true;
//            }
        }
    }
